package actions;

import java.sql.SQLException;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import model.Database;

import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import db.DbException;
import forms.DecisionForm;

public class DecisionAction extends Action {
	public ActionForward execute(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws DbException, SQLException, ClassNotFoundException{
		DecisionForm iForm = (DecisionForm) form;
		int userId = iForm.getUserId();
		String decision = iForm.getDecision();
		Database.updateAppStatus(userId, decision);
		
		
		return mapping.findForward("success");
	}

}
